package com.maybach.core.ao;

import com.maybach.common.BizResult;
import com.maybach.common.dto.UserInfoDTO;
import com.maybach.core.form.user.UserForm;
import com.maybach.core.form.user.UserQueryForm;
import com.maybach.core.form.user.UserUpdateStatusForm;
import com.maybach.util.query.support.PageResult;

/**
 * Created by zhaoshuai on 16/1/14.
 */
public interface UserAO {


    /**
     * @param query
     * @return
     */
    PageResult<UserInfoDTO> queryUser(UserQueryForm query);

    /**
     * 查询认证用户
     * @param query
     * @return
     */
    PageResult<UserInfoDTO> queryAuthenticateUser(UserQueryForm query);



    /**
     * 修改用户状态
     *
     * @param form
     * @return
     */
    BizResult updateUserStatus(UserUpdateStatusForm form);

    /**
     * 创建用户
     *
     * @param userForm
     * @return
     */
    Long addUser(UserForm userForm);

    /**
     * 查询用户
     *
     * @param id
     * @return
     */
    UserForm getUserForm(Long id);

    /**
     * 更新用户
     *
     * @param userForm
     */
    void updateUser(UserForm userForm);

    /**
     * 另一个用户是否存在
     *
     * @param loginName
     * @param id
     * @return
     */
    boolean isAnotherUserExit(String loginName, Long id);

}
